require.config({
    urlArgs: "v=" + requirejs.s.contexts._.config.config.site.version,
    packages: [{
            name: 'moment',
            location: '../libs/moment',
            main: 'moment'
        }
    ],
    //在打包压缩时将会把include中的模块合并到主文件中
    // include: ['css', 'layer', 'toastr', 'fast', 'frontend', 'frontend-init'],
    paths: {
        'lang': "empty:",
        // 以下的包从bower的libs目录加载
        'mui':'wap/mui.min',
        'jquery': 'wap/jquery.min',
        'form': 'wap/require-form',
        'fastclick':'wap/fastclick',
        'page': 'wap/require-paginator',
        'swiper':'wap/swiper',
        'template': '../libs/art-template/dist/template-native',
        'validator': '../libs/nice-validator/dist/jquery.validator',
        'validator-lang': '../libs/nice-validator/dist/local/zh-CN',
        'picker':'wap/mui.picker.all',
        'common':'wap/common',
        'BMap': '//api.map.baidu.com/api?v=1.0&ak=csilSIZR2SrPbvGFV6ETGFiIGrqtbyid',
        // // 'citypicker':'https://cdn.bootcss.com/jquery-weui/1.2.1/js/city-picker.min',
        // 'citypicker':'wap/city-picker.min',
        'async': 'async',

        // 'selectpage': '../libs/fastadmin-selectpage/selectpage',
        'jqueryui': '../libs/jquery-ui/jquery-ui',
        // 'map':'index/require-map',
    },
    // shim依赖配置
    shim: {
        'wx':['weixin'],
        'validator-lang': ['validator'],
        'picker': ['mui']
    },
    baseUrl: requirejs.s.contexts._.config.config.site.cdnurl + '/assets/js/', //资源基础路径
    map: {
        '*': {
            'css': '../libs/require-css/css.min'
        }
    },
    waitSeconds: 30,
    charset: 'utf-8' // 文件编码
});



// require(['jquery','jquery-weui','weui'], function ($,JqueryWuei,Wuei) {
//     //初始配置
//     var Config = requirejs.s.contexts._.config.config;
//     //将Config渲染到全局
//     window.Config = Config;
//     // 配置语言包的路径
//     var paths = {};
//     paths['lang'] = Config.moduleurl + '/ajax/lang?callback=define&controllername=' + Config.controllername;
//     // 避免目录冲突
//     paths['mobile/'] = 'mobile/';
//     require.config({paths: paths});

//     // 初始化
//     $(function () {
//         //console.log(Config.jsname);
//         require(['mobile'], function (Mobile) {
//             console.log(Mobile)
//             if (Config.jsname) {
//                 require([Config.jsname], function (Controller) {
//                     Controller[Config.actionname] != undefined && Controller[Config.actionname]();
//                 }, function (e) {
//                     console.error(e);
//                     // 这里可捕获模块加载的错误
//                 });
//             }
//         })

//     });
// });

require(['jquery','mui','common'], function ($,$$) {
    var Config = requirejs.s.contexts._.config.config;
    //将Config渲染到全局
    window.Config = Config;
    // 配置语言包的路径
    var paths = {};
    paths['lang'] = Config.moduleurl + '/ajax/lang?callback=define&controllername=' + Config.controllername;
    // 避免目录冲突
    paths['mobile/'] = 'mobile/';
    require.config({paths: paths});
    $$.init();
    (function($$) {
        $$('body').on('tap','a',function () {
            window.top.location.href=this.href;
        })
        require(['wap/fast'], function (Fast) {
            console.log(Config.jsname);
            if (Config.jsname) {
                require([Config.jsname], function (Controller) {
                    Controller[Config.actionname] != undefined && Controller[Config.actionname]();
                }, function (e) {
                    console.error(e);
                    // 这里可捕获模块加载的错误
                });
            }
        })
    })(mui);


})